<?php


namespace app\api\controller;


use app\common\controller\Api;
use app\common\library\design\observer\Message;
use app\common\library\design\observer\Mobile;
use app\common\library\design\observer\Subject;
use app\common\library\factory\kuaidi\AliyunKdFactory;
use app\common\library\factory\kuaidi\Kuaidi100KdFactory;

class Test extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];


    //测试观察者模式
    public function observer(){
        $subject = new Subject();
        $message = new Message();
        $mobile  = new Mobile();
        $subject->attach($message);
        $subject->attach($mobile);
        $data    = [
            'name' => '张奇',
            'mobile' => '18688886666'
        ];
        $subject->notity($data);
    }

    public function getLogisicsInfo(){
        var_dump(Kuaidi100KdFactory::getLogisticsInfo()->getLogisticsInformation([]));
    }


    public function uploadLogisicsInfo(){
        var_dump(Kuaidi100KdFactory::uploadLogisticsInfo()->upload([]));
    }



}